import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { HomeModule } from './@theme/components/home/home.module'
import { LoginModule } from "./@theme/components/login/login.module";

import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { HttpClientModule, HttpClient, HTTP_INTERCEPTORS } from '@angular/common/http';
import { AppRoutingModule } from './app-routing.module';
import { FormsModule } from '@angular/forms'

import { DefaultInterceptor } from './@core/interceotor/login-interceotor';

import { ApiModule } from '../app/@core/service/typescript-angular-client/api.module';
import { APIS } from '../app/@core/service/typescript-angular-client/api/api'
import { ApiModule as LoginApiModule  } from '../app/@core/service/login-service/api.module';
import { ApiModule as PersonSelectApiModule  } from '../app/@core/service/person-select-service/api.module';
import { ApiModule as HandleApiModule  } from '../app/@core/service/handle-service/api.module';
import { AppComponent } from './app.component';

import { Configuration ,ConfigurationParameters} from '../app/@core/service/typescript-angular-client/configuration';
import { registerLocaleData } from '@angular/common';
import zh from '@angular/common/locales/zh';

import { NzCascaderModule } from 'ng-zorro-antd/cascader';
import { IconDefinition } from '@ant-design/icons-angular';
import { NzIconModule, NZ_ICON_DEFAULT_TWOTONE_COLOR, NZ_ICONS } from 'ng-zorro-antd/icon';
// 引入你需要的图标，比如你需要 fill 主题的 AccountBook Alert 和 outline 主题的 Alert，推荐 ✔️
import { AccountBookFill, AlertFill, AlertOutline } from '@ant-design/icons-angular/icons';
// import { MessagerModule } from 'ng-easyui/components/messager/messager.module';
import { EasyUIModule } from 'ng-easyui'

import { BizfileService } from './@core/service/case-review/doc-service/api/bizfile.service'
import { DocgenService } from './@core/service/case-review/doc-select/api/docgen.service'
import { CommonMouleModule } from './@theme/common/common-moule/common-moule.module';

// import { CasereviewComponent } from './@theme/components/home/casereview/casereview.component';
import {EvidenceService} from './@core/service/evidence/api/evidence.service';
import { DocsService } from './@core/service/docs-service/docs-service.service';
import { TaskService } from './@core/service/task-serivce/api/task.service'

 // 视频播放控件
import {VgCoreModule} from 'videogular2/compiled/core';
import {VgControlsModule} from 'videogular2/compiled/controls';
import {VgOverlayPlayModule} from 'videogular2/compiled/overlay-play';
import {VgBufferingModule} from 'videogular2/compiled/buffering';



const icons: IconDefinition[] = [ AccountBookFill, AlertOutline, AlertFill ];

registerLocaleData(zh);
export function apiConfigFactory():Configuration{
  const params: ConfigurationParameters = {
      basePath:'/api'
  }
  return new Configuration(params); 
}

const INTERCEPTOR_PROVIDES = [
  { provide: HTTP_INTERCEPTORS, useClass: DefaultInterceptor, multi: true },
  { provide: NZ_ICON_DEFAULT_TWOTONE_COLOR, useValue: '#00ff00' },
  { provide: NZ_ICONS, useValue: icons }
]; 

@NgModule({ 
  declarations: [
    AppComponent  ],
  imports: [
    BrowserModule,
    AppRoutingModule,
    LoginApiModule,
    LoginModule,
    HomeModule,


    FormsModule,
    HttpClientModule,
    BrowserAnimationsModule, 
    ApiModule.forRoot(apiConfigFactory),
    NzCascaderModule,
    PersonSelectApiModule,
    NzCascaderModule,
    HandleApiModule,
    CommonMouleModule,
  ],   
  exports:[

  ],
  bootstrap: [AppComponent],
  providers:[INTERCEPTOR_PROVIDES,BizfileService,DocgenService,EvidenceService, DocsService,TaskService],
})
export class AppModule { }
 